1. Field of the Invention
The present invention relates to a 3D (Three Dimensional) image acquisition method for a technique of measuring a 3D shape of an object in a non-contact state, and a 3D image acquisition apparatus for carrying out this method.
2. Description of the Related Art
Conventional 3D object shape measuring methods applied to 3D image acquisition apparatuses as 3D shape measuring techniques are generally classified into two types. One is a method in which the time of propagation of light is measured, and the other is a method making use of a “principle of triangulation”. The former is a theoretically ideal method because there is no dead angle, but it has problems with measured time and precision. Thus, the latter using “principle of triangulation” is mainly used.
Methods using the principle of triangulation are classified into an active method and a passive method called “passive stereo method”. In the passive stereo method, features in the images obtained by two cameras situated at different locations are made to correspond. On the basis of a result of the correspondence and a pre-measured positional relationship between two cameras, a distance up to an object is found by the principle of triangulation. The passive stereo method, however, has drawbacks that the correspondence of features in the images is difficult and the shape of an object without texture cannot be measured.
As an example of the active method using the principle of triangulation, there is known a “light projection method”. In this method, one of the two cameras, is replaced with a light source, and an image of the light source at the surface of the object is observed by the camera situated at the other point and the shape of the object is measured. The “light projection method” is also classified into “spot light projection method”, “slit light projection method” and “pattern light projection method”.
In the spot light projection method, only a point of an object can be measured by a single image input. In the slit light projection method, one line of an object can be measured by a single image input. However, in order to measure the shape of the entire area of the object, image input needs to be repeated a number of times by scanning projection light, and a great deal of time is required.
On the other hand, in the pattern light projection method, a two-dimensional (2D) pattern such as a stripe pattern or a matrix pattern is projected. This method is advantageous in that only one input of a pattern projection image needs to be performed.
The pattern light projection method is also called “spatial encoding method”. The “spatial encoding method” is classified into “pattern shape encoding” and “gradation encoding”. As the pattern shape encoding, a method using a distribution of opening width of a slit and a method using an M-series encoding have been proposed, but these are less practical because of problems with measurement density and stability of measurement.
Meanwhile, the “gradation encoding” is classed into “gray scale encoding” and “color tone encoding”. However, either method has a drawback that the number of recognizable gradations is small. As regards the gray scale encoding, the maximum number of recognizable gradations is normally 5. As regards the color tone encoding, a greater number of gradations are not usable, except the cases of white and low-saturation colors.
To solve these problems, a method has been proposed wherein one code is assigned to a combination a plurality of colors or gray levels.
Prior-art matrix pattern encoding and stripe pattern encoding will now be described.
As regards the matrix pattern, U.S. Pat. No. 2,565,685, for instance, discloses a “spatial pattern encoding method”. This method employs a multi-pattern matrix plate pattern, which has gray scale areas of three or more values, color areas of three or more colors, or three or more gradation areas of a combination of gray scales and colors. In this method, at least three kinds of gradation areas adjoin at an intersection of boundary lines of gradation areas. Major codes corresponding to the kinds and order of gradations are assigned to intersections of a projection image produced by projecting the pattern on the object. Then, the major codes, or combinational codes of major code at the intersection and major codes of intersections around this intersection, are given as characteristic codes for intersection recognition.
FIG. 9 shows an example of the matrix pattern using three-value gradations in the above-described prior-art spatial pattern encoding method. White is represented by “2”, black is by “0”, and gray is by “1”. FIG. 10 is a block flow chart illustrating the process by the spatial pattern encoding method.
In step ST1001, recognition thresholds for three-value conversion are found. In step ST1002, three-value conversion for each pixel is effected, like “0”, “1” or “2”.
In step ST1003, node selection is effected to extract, as a node, the corner or edge intersection of each matrix plate area of the multi-value matrix pattern.
In step ST1004, a decoding process is performed to provide one of a plurality of codes as a major code in accordance with a gradation distribution surrounding the extracted node.
In step ST1005, a result of code recognition and code numbering is recorded on a table (memory).
This method is advantageous in that it provides a pattern structure which can produce many characteristic codes by only single projection of the pattern with at least three gradations.
In order to derive encoded information from a received pattern and derive 3D information, it is important to exactly read a luminance variation and to detect as exactly as possible boundaries of one block in the matrix. A graph shown below the matrix pattern in FIG. 9 indicates gradations of the second line from above in the matrix pattern. The inclination of a graph curve increases near inflection points (i.e. two occurrences of (1) in (1)(2)(1) in FIG. 9), which are neither local maximum points or local minimum points, due to diffusion of projected light. Consequently, extraction of a matrix structure (division of blocks in the matrix) becomes disadvantageously unstable. In short, the degree of deviation to the left and right of an inflection point increases, and the reliability lowers.
FIG. 11 shows prior art in the case where gradations of three colors, R (Red), G (Green) and B (Blue), are used in the spatial pattern encoding method. Assume that “0” is assigned to R, “1” to G, and “2” to B.
A graph below the matrix pattern in FIG. 11 indicates luminance values of R, G and B of the second line from above in the matrix pattern. For example, in the case of an object (a high-saturation red object) having such surface reflectance characteristics that reflection signals of a G component and a B component are substantially zero while a reflection signal of an R component is large, a signal of a local maximum is obtained at the luminance value of R in the second line from above in the pattern of FIG. 11. By contrast, the luminance values of G and B have nearly noise levels. In this situation, decoding is impossible. Similarly, decoding is very difficult for an object having such surface reflectance characteristics that even one of reflection signals of R, G and B is substantially zero. In order words, decoding is successfully carried out for an object surface of a white-based color or a low-saturation color. However, for an object having such surface reflectance characteristics that even one of reflection signals of R, G and B components may take a nearly zero value, determination based on a color obtained from a combination of R, G and B is difficult.
Prior art of a stripe pattern, which is disclosed in, e.g. the Journal of the Institute of Electronics and Communication Engineers (Vol. J61-D, No. 6, pp. 411–418, 1978), will now be described. FIG. 12 shows an example of a stripe pattern encoded by colors of R, G and B. This example differs from the example of FIG. 11, not only because the former is a stripe and the latter is a matrix, but also because black areas (hatched in FIG. 12) are present among R, G and B. The presence of black areas reduces the possibility of mixing of colors due to diffusion of light.
However, in this prior-art example, too, decoding is difficult for an object having such surface reflectance characteristics that even one of reflection signals of R, G and B components may take a nearly zero value.
The present invention has been made to solve the problems of the above-described prior art. The object of this invention is to provide a 3D image acquisition method and a 3D image acquisition apparatus based on spatial pattern encoding, wherein stripe boundary extraction from a stripe pattern projection image and block boundary extraction from a matrix pattern projection image can exactly be performed, and exact decoding is performed from an encoded projection image of an object even where the object is not of a white-based color or a low-saturation color.